<html xmlns="http://www.w3.org/1999/xhtml" xmlns:c="http://java.sun.com/jstl/core"
      xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:t="http://myfaces.apache.org/tomahawk"
      xmlns:v="http://corejsf.com/validator">

    <f:view>
        <f:loadBundle var="text" basename="#{paymentTypeForm.bundleName}"/>
        <head>
            <title>#{text['paymentTypeDetail.title']}</title>
            <meta name="heading" content="#{text['paymentTypeDetail.heading']}"/>
            <meta name="menu" content="CatalogsMenu"/>
        </head>
        
        <div class="separator"></div>

        <h:form id="paymentTypeForm">
            <h:inputHidden value="#{paymentTypeForm.paymentType.id}" id="id"/>

            <h:panelGrid columns="3">

                <h:panelGroup styleClass="buttonBar right">
                    <h:commandButton value="#{text['button.save']}" action="#{paymentTypeForm.save}" id="save" styleClass="button"/>
                    <c:if test="${not empty paymentTypeForm.paymentType.id}">
                        <h:commandButton value="#{text['button.delete']}" action="#{paymentTypeForm.delete}"
                                         id="delete" styleClass="button"/>
                    </c:if>
                    <h:commandButton value="#{text['button.cancel']}" action="cancel" immediate="true"
                                     id="close" styleClass="button"/>
                </h:panelGroup>
                <h:outputText/><h:outputText/>

                <h:panelGroup styleClass="info">
                    <c:choose>
                        <c:when test="${param.from == 'list' or empty paymentTypeForm.paymentType.id}">
                            <h:outputText value="#{text['paymentTypeDetail.admin.message']}"/>
                        </c:when>
                        <c:otherwise><h:outputText value="#{text['paymentTypeDetail.message']}"/></c:otherwise>
                    </c:choose>
                </h:panelGroup>
                <h:outputText/><h:outputText/>
                
                <h:panelGroup>
                    <div>
                        <div class="left">
                            <h:outputLabel styleClass="desc" for="code" value="#{text['paymentType.code']}"/>
                            <h:inputText styleClass="text medium" id="code" value="#{paymentTypeForm.paymentType.code}" maxlength="100" required="true"/>
                            <t:message for="code" styleClass="fieldError"/>
                        </div>
                        <div>
                            <h:outputLabel styleClass="desc" for="description" value="#{text['paymentType.description']}"/>
                            <h:inputText styleClass="text medium" id="description" value="#{paymentTypeForm.paymentType.description}" maxlength="100" required="true"/>
                            <t:message for="description" styleClass="fieldError"/>
                        </div>
                    </div>
                </h:panelGroup>
                <h:outputText/><h:outputText/>

                <!--h:panelGroup>
                    <div>
                        <div class="left">
                            <h:outputLabel styleClass="desc" for="titulo" value="#{text['contact.title']}"/>
                            <h:inputText styleClass="text medium" id="titulo" value="#{contactForm.contact.title}"/>
                            <t:message for="titulo" styleClass="fieldError"/>
                        </div>
                        <div>
                            <h:outputLabel styleClass="desc" for="position" value="#{text['contact.position']}"/>
                            <h:inputText styleClass="text medium" id="position" value="#{contactForm.contact.position}"/>
                            <t:message for="position" styleClass="fieldError"/>
                        </div>
                    </div>
                </h:panelGroup>
                <h:outputText/><h:outputText/>
                
                <h:panelGroup>
                    <div>
                        <div class="left">
                            <h:outputLabel styleClass="desc" for="phone" value="#{text['contact.phone']}"/>
                            <h:inputText styleClass="text medium" id="phone" value="#{contactForm.contact.phone}"/>
                            <t:message for="phone" styleClass="fieldError"/>
                        </div>
                        <div>
                            <h:outputLabel styleClass="desc" for="movil" value="#{text['contact.movil']}"/>
                            <h:inputText styleClass="text medium" id="movil" value="#{contactForm.contact.movil}"/>
                            <t:message for="movil" styleClass="fieldError"/>
                        </div>
                    </div>
                </h:panelGroup-->
                <h:outputText/><h:outputText/>
            </h:panelGrid>
        </h:form>

        <script type="text/javascript">
            Form.focusFirstElement($('paymentTypeForm'));
            highlightFormElements();
        </script>
    </f:view>
</html>